home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / S / SurferPlus / surferplus.r < prev    next >
Encoding:
Text File  |  1990-12-07  |  6.8 KB  |  341 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Products Presents
  4. #
  5. #    S U R F E R    ----- A CommToolbox Sample Application
  6. #        by Alex Kazim
  7. #
  8. #    Based on the MacDTS Simple Sample Application
  9. #
  10. #    Surfer.r    -    Rez Source
  11. #
  12. #    Copyright © 1988-9 Apple Computer, Inc.
  13. #    All rights reserved.
  14. #
  15. #    Versions:    Sample 1.0                    08/88
  16. #                Sample 1.01                    11/88
  17. #                Surfer 0.5                    08/89
  18. ------------------------------------------------------------------------------*/
  19.  
  20.  
  21. #include "Types.r"
  22. #include "SysTypes.r"
  23. #include "Surferplus.h"
  24.  
  25.  
  26. /* So the Finder can tell who we are    */
  27.  
  28. resource 'vers' (1) {
  29.     0x01, 
  30.     0x00, 
  31.     development, 
  32.     0x12, 
  33.     verUS,
  34.     "1.0D1",
  35.     "1.0D1, Copyright © Apple Computer, Inc. 1988-1989.  Written by Alex Kazim"
  36. };
  37.  
  38.  
  39. /* we use an MBAR resource to conveniently load all the menus */
  40.  
  41. resource 'MBAR' (rMenuBar, preload) {
  42.     { mApple, mFile, mEdit, mSettings };    /* four menus */
  43. };
  44.  
  45.  
  46. resource 'MENU' (mApple, preload) {
  47.     mApple, textMenuProc,
  48.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  49.     enabled, apple,
  50.     {
  51.         "About Surfer…",
  52.             noicon, nokey, nomark, plain;
  53.         "-",
  54.             noicon, nokey, nomark, plain
  55.     }
  56. };
  57.  
  58. resource 'MENU' (mFile, preload) {
  59.     mFile, textMenuProc,
  60.     MenuItem15,                /* enable Quit only, program enables others */
  61.     enabled, "File",
  62.     {
  63.         "New",
  64.             noicon, "N", nomark, plain;
  65.         "Open",
  66.             noicon, "O", nomark, plain;
  67.         "-",
  68.             noicon, nokey, nomark, plain;
  69.         "Close",
  70.             noicon, "W", nomark, plain;
  71.         "Save",
  72.             noicon, "S", nomark, plain;
  73.         "Save As…",
  74.             noicon, nokey, nomark, plain;
  75.         "Revert",
  76.             noicon, nokey, nomark, plain;
  77.         "-",
  78.             noicon, nokey, nomark, plain;
  79.         "Send File",
  80.             noicon, "T", nomark, plain;
  81.         "Receive File",
  82.             noicon, "R", nomark, plain;
  83.         "-",
  84.             noicon, nokey, nomark, plain;
  85.         "Page Setup…",
  86.             noicon, nokey, nomark, plain;
  87.         "Print…",
  88.             noicon, nokey, nomark, plain;
  89.         "-",
  90.             noicon, nokey, nomark, plain;
  91.         "Quit",
  92.             noicon, "Q", nomark, plain
  93.     }
  94. };
  95.  
  96. resource 'MENU' (mEdit, preload) {
  97.     mEdit, textMenuProc,
  98.     NoItems,                /* disable everything, program does the enabling */
  99.     enabled, "Edit",
  100.      {
  101.         "Undo",
  102.             noicon, "Z", nomark, plain;
  103.         "-",
  104.             noicon, nokey, nomark, plain;
  105.         "Cut",
  106.             noicon, "X", nomark, plain;
  107.         "Copy",
  108.             noicon, "C", nomark, plain;
  109.         "Paste",
  110.             noicon, "V", nomark, plain;
  111.         "Clear",
  112.             noicon, nokey, nomark, plain
  113.     }
  114. };
  115.  
  116. resource 'MENU' (mSettings, preload) {
  117.     mSettings, textMenuProc,
  118.     NoItems,                /* disable everything, program does the enabling */
  119.     enabled, "Settings",
  120.      {
  121.         "Connection…",
  122.             noicon, "1", nomark, plain;
  123.         "File Transfer…",
  124.             noicon, "2", nomark, plain;
  125.         "Terminal…",
  126.             noicon, "3", nomark, plain
  127.     }
  128. };
  129.  
  130.  
  131. /* this ALRT and DITL are used as an About screen */
  132.  
  133. resource 'ALRT' (rAboutAlert, purgeable) {
  134.     {40, 20, 180, 400},
  135.     rAboutAlert,
  136.     { /* array: 4 elements */
  137.         /* [1] */
  138.         OK, visible, silent,
  139.         /* [2] */
  140.         OK, visible, silent,
  141.         /* [3] */
  142.         OK, visible, silent,
  143.         /* [4] */
  144.         OK, visible, silent
  145.     }
  146. };
  147.  
  148. resource 'DITL' (rAboutAlert, purgeable) {
  149.     {    /* array DITLarray: 5 elements */
  150.         /* [1] */
  151.         {99, 285, 119, 365},
  152.         Button {
  153.             enabled,
  154.             "OK"
  155.         },
  156.         /* [2] */
  157.         {8, 8, 26, 250},
  158.         StaticText {
  159.             disabled,
  160.             "SURFER: A CommToolbox Application"
  161.         },
  162.         /* [3] */
  163.         {103, 6, 120, 251},
  164.         StaticText {
  165.             disabled,
  166.             "Copyright © 1988-9 Apple Computer"
  167.         },
  168.         /* [4] */
  169.         {52, 8, 69, 260},
  170.         StaticText {
  171.             disabled,
  172.             "Bytes by Alex & Mary, Words by Rob"
  173.         },
  174.         /* [5] */
  175.         {86, 6, 103, 211},
  176.         StaticText {
  177.             disabled,
  178.             "Based on Sample from MacDTS"
  179.         }
  180.     }
  181. };
  182.  
  183.  
  184. /* this ALRT and DITL are used as an error screen */
  185.  
  186. resource 'ALRT' (rUserAlert, purgeable) {
  187.     {40, 20, 180, 350},
  188.     rUserAlert,
  189.     { /* array: 4 elements */
  190.         /* [1] */
  191.         OK, visible, silent,
  192.         /* [2] */
  193.         OK, visible, silent,
  194.         /* [3] */
  195.         OK, visible, silent,
  196.         /* [4] */
  197.         OK, visible, silent
  198.     }
  199. };
  200.  
  201.  
  202. resource 'DITL' (rUserAlert, purgeable) {
  203.     { /* array DITLarray: 3 elements */
  204.         /* [1] */
  205.         {100, 230, 120, 310},
  206.         Button {
  207.             enabled,
  208.             "OK"
  209.         },
  210.         /* [2] */
  211.         {10, 60, 76, 310},
  212.         StaticText {
  213.             disabled,
  214.             "^0"
  215.         },
  216.         /* [3] */
  217.         {8, 8, 40, 40},
  218.         Icon {
  219.             disabled,
  220.             2
  221.         }
  222.     }
  223. };
  224.  
  225.  
  226. resource 'WIND' (rWindow, preload, purgeable) {
  227.     {40, 5, 340, 512},
  228.     documentProc, visible, noGoAway, 0x0, "Surf the Wave"
  229. };
  230.  
  231.  
  232. /* we put the latest SIZE template here so we can rez with MPW 2.0 */
  233.  
  234. type 'SIZE' {
  235.         boolean        dontSaveScreen,
  236.                     saveScreen;
  237.         boolean     ignoreSuspendResumeEvents,
  238.                     acceptSuspendResumeEvents;
  239.         boolean        enableOptionSwitch,
  240.                     disableOptionSwitch;
  241.         boolean        cannotBackground,
  242.                     canBackground;
  243.         boolean        notMultiFinderAware,
  244.                     multiFinderAware;
  245.         boolean        notOnlyBackground,
  246.                     onlyBackground;
  247.         boolean        dontGetFrontClicks,
  248.                     getFrontClicks;
  249.         unsigned bitstring[9] = 0;
  250.         unsigned longint;    /* preferred memory size in bytes */
  251.         unsigned longint;    /* minimum memory size in bytes */
  252. };    /* ignore the warning caused by re-defining SIZE */
  253.  
  254.  
  255. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  256.  
  257. resource 'SIZE' (-1) {
  258.     dontSaveScreen,
  259.     acceptSuspendResumeEvents,
  260.     enableOptionSwitch,
  261.     canBackground,        /* we can background; we don't currently, but our sleep value */
  262.                         /* guarantees we don't hog the Mac while we are in the background */
  263.     multiFinderAware,    /* this says we do our own activate/deactivate; don't fake us out */
  264.     notOnlyBackground,    /* this is definitely not a background-only application! */
  265.     dontGetFrontClicks,    /* change this is if you want "do first click" behavior like the Finder */
  266.     kPrefSize * 1024,
  267.     kMinSize * 1024    
  268. };
  269.  
  270. /* vertical and horizontal scroll bars for the window */
  271. resource 'CNTL' (128) {
  272.     {-1, 492, 286, 508},
  273.     0,
  274.     visible,
  275.     0,
  276.     0,
  277.     scrollBarProc,
  278.     0,
  279.     "vertical scroll bar"
  280. };
  281.  
  282. resource 'CNTL' (129) {
  283.     {285, -1, 301, 493},
  284.     0,
  285.     visible,
  286.     0,
  287.     0,
  288.     scrollBarProc,
  289.     0,
  290.     "hori scroll bar"
  291. };
  292.  
  293.  
  294. resource 'BNDL' (128) {
  295.     'SurF',
  296.     0,
  297.     {    /* array TypeArray: 2 elements */
  298.         /* [1] */
  299.         'FREF',
  300.         {    /* array IDArray: 1 elements */
  301.             0, 128
  302.         },
  303.         /* [2] */
  304.         'ICN#',
  305.         {    /* array IDArray: 1 elements */
  306.             0, 128
  307.         }
  308.     }
  309. };
  310.  
  311.  
  312. resource 'ICN#' (128) {
  313.     {    /* array: 2 elements */
  314.         /* [1] */
  315.         $"0400 0000 2080 002C 0E02 0050 1107 0000"
  316.         $"514A 8000 110A 8160 0E0A 8290 209A 4000"
  317.         $"0412 4000 0012 5040 0012 4880 0012 4700"
  318.         $"0012 4700 0012 4700 FFF2 777F 0412 4211"
  319.         $"4052 4F80 0012 7FC4 0112 7FC0 4812 4FC0"
  320.         $"0012 4748 0012 4740 0092 4742 2412 4F80"
  321.         $"0012 4D80 0012 4D90 2092 4882 0212 4880"
  322.         $"0012 58C0 200F 98C8 0000 0000 0442 2202",
  323.         /* [2] */
  324.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  325.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  326.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  327.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  328.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  329.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  330.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  331.         $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
  332.     }
  333. };
  334.  
  335. resource 'FREF' (128) {
  336.     'APPL',
  337.     0,
  338.     ""
  339. };
  340.  
  341.